package com.bookstore.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/*
    Book类  用于保存书籍信息
 */
public class Book {
    private Integer bid;//书籍编号
    private Integer uid;//商家id
    private String bookName;//书名
    private BookType btype;//书籍类别
    private Double price;//单价
    private String publishing;//出版社
    private String bigImg;//商品封面大图
    private Integer inventory;//库存数量
    private String Author;//作者
    private String content;//书籍描述
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern  = "yyyy-MM-dd",timezone = "GMT+8")
    private Date pubTime;//出版时间

    public Book() {
    }

    public Book(Integer bid, Integer uid, String bookName,
                BookType btype, Double price, String publishing, String bigImg,
                Integer inventory, String author, String content, Date pubTime) {
        this.bid = bid;
        this.uid = uid;
        this.bookName = bookName;
        this.btype = btype;
        this.price = price;
        this.publishing = publishing;
        this.bigImg = bigImg;
        this.inventory = inventory;
        Author = author;
        this.content = content;
        this.pubTime = pubTime;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bid=" + bid +
                ", uid=" + uid +
                ", bookName='" + bookName + '\'' +
                ", btype=" + btype +
                ", price=" + price +
                ", publishing='" + publishing + '\'' +
                ", bigImg='" + bigImg + '\'' +
                ", inventory=" + inventory +
                ", Author='" + Author + '\'' +
                ", content='" + content + '\'' +
                ", pubTime=" + pubTime +
                '}';
    }

    public Integer getBid() {
        return bid;
    }

    public void setBid(Integer bid) {
        this.bid = bid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public BookType getBtype() {
        return btype;
    }

    public void setBtype(BookType btype) {
        this.btype = btype;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getPublishing() {
        return publishing;
    }

    public void setPublishing(String publishing) {
        this.publishing = publishing;
    }

    public String getBigImg() {
        return bigImg;
    }

    public void setBigImg(String bigImg) {
        this.bigImg = bigImg;
    }

    public Integer getInventory() {
        return inventory;
    }

    public void setInventory(Integer inventory) {
        this.inventory = inventory;
    }

    public String getAuthor() {
        return Author;
    }

    public void setAuthor(String author) {
        Author = author;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getPubTime() {
        return pubTime;
    }

    public void setPubTime(Date pubTime) {
        this.pubTime = pubTime;
    }
}
